Skip to main content

Get Notification Feed

The getNotificationFeed() function is used to retrieve the user activity feed, including details about notification items, associated users, topics, widgets, and an error message in case of failure.

Steps to Get Notification Feed

  1. Build a GetNotificationFeedRequest object using the GetNotificationFeedRequestBuilder class.

  2. Call the getNotificationFeed() function using the instance of the LMFeedClient class.

  3. Use the response as per your requirement.

     // Build the request object
    GetNotificationFeedRequest notificationFeedRequest = (GetNotificationFeedRequestBuilder()
    ..page(1)
    ..pageSize(10))
    .build();

    // Get the response from calling the function
    final GetNotificationFeedResponse notificationFeedResponse = await lmFeedClient.getNotificationFeed(notificationFeedRequest);

    // Process the response, as per requirement
    if(notificationFeedResponse.success){
    // your function to handle successful retrieval of notification feed
    handleNotificationFeed(notificationFeedResponse);
    }else{
    // your function to handle error message
    handleNotificationFeedError(notificationFeedResponse.errorMessage);
    }

Models

GetNotificationFeedRequest

List of parameters for the GetNotificationFeedRequest class

VariableTypeDescriptionOptional
pageintPage number for pagination
pageSizeintNumber of items per page

GetNotificationFeedResponse

List of parameters for the GetNotificationFeedResponse class

VariableTypeDescriptionOptional
successboolAPI success status
errorMessageStringError message in case of failure
itemsList<NotificationFeedItem>List of notification items
usersMap<String, User>Map of users associated with notifications
topicsMap<String, Topic>Map of topics associated with notifications
widgetsMap<String, WidgetModel>Map of widgets associated with notifications